﻿<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <title>首页</title>
  <meta name="page-view-size" content="1280*720" />
  <link rel="stylesheet" href="./css/base.css" />
  <link rel="stylesheet" href="./css/index.css" />
  <script type="text/javascript" src="./lib/js/evm.js"></script>
  <script type="text/javascript" src="./lib/js/Evm_djyw.js"></script>
  <script type="text/javascript" src="./lib/js/key.js"></script>
  <script src="lib/js/md5.js" type="text/javascript" charset="utf-8"></script>
  <script src="./lib/js/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
  <script src="./lib/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
  <script src="./js/api.js" type="text/javascript" charset="utf-8"></script>
  <script src="./js/public.js" type="text/javascript" charset="utf-8"></script>
</head>

<body onUnload="exitPage();">
  <div class="index-bg" id="indexMain">
    <div class="model"></div>
    <div class="model"><img src="images/indexNav/index1.png" /></div>
    <div class="model"><img src="images/indexNav/index2.png" /></div>
    <div class="model"><img src="images/indexNav/index3.png" /></div>
    <div class="model"><img src="images/indexNav/index4.png" /></div>
    <div class="model"><img src="images/indexNav/index5.png" /></div>
    <div class="model"><img src="images/indexNav/index6.png" /></div>
    <div class="model"><img src="images/indexNav/index7.png" /></div>
    <div class="model"><img src="images/indexNav/index8.png" /></div>
    <div class="model"><img src="images/indexNav/index9.png" /></div>
    
    <!-- <div class="bottomBg"></div> -->
  </div>

  <!--<div class="login-bg">
			<div class="login-img">
				<img id="loginImg" src="" alt="">
			</div>
			<div class="login-msg">
				请扫码登录
			</div>
		</div>-->
</body>
<script src="js/video.js"></script>
<script>
  // 首页视频
  var params = {};
  var mediaStr;
  // GetDatas('indexVideo', params, function (err, res) {
  mediaStr = "http://tv.binhai.cst-info.cn:8000/public.mp4";
  // mediaStr = "http://tv.jingjiang.cst-info.cn:8000/index.mp4";
  // 	// console.log(res.data.video, '1111')

  // })
  setTimeout(function () {
    try {
      var videoSize = [58, 150, 575, 280]; //控制位置和宽高的方法 left top widht height
      mp = runVideo(mediaStr, videoSize);
    } catch (e) {}
  }, 500);

  var video_number;
  var video_time;
  var loop = setInterval(function () {
    video_number = mp.getCurrentPlayTime();
    video_time = mp.getMediaDuration();

    if (video_number > video_time - 3) {
      mp.playByTime(0, 0, 1);
    }
  }, 2000);

  // console.log(window);

  var modelIndex = {
    isVideo: true,
    disUser: false,
    isIndex: true,
    disHeader: true,
    index: 0, //初始位置
    listName: "model", //模块名称
    containerId: "indexMain", //包含模块的标签id
  };

  var data = [{
      name: "视频窗口",
      url: "play.html",
    },

    {
      name: "滨彬有礼",
      url: "B-bbyl.html",
      model: 'bbyl'
    },
    {
      name: "志愿花开",
      // cid: "55",
      url: "D_Volunteer_flower.html",
      model: 'volunteer'
    },
    {
      name: "视频会议",
      url: "A_SingleList.html",
      model: "site",
    },
    {
      name: "文明超市",
      url: "A-doubleList.html",
      model: "goodlist",
    },
    {
      name: "理论宣讲",
      cid: "29",
      url: "A-llxj.html",
      model: "preach",
    },
    {
      name: "教育实践",
      cid: "30",
      url: "A-jysj.html",
      model: "edu",
    },
    {
      name: "多彩文化",
      cid: "37",
      url: "A-dcwh.html",
      model: "culture",
    },
    {
      name: "科技科普",
      cid: "41",
      url: "A-kjkp.html",
      model: 'tech'
    },
    {
      name: "健康体育",
      cid: "47",
      url: "A-jkty.html",
      model: 'sport'
    },

    // {
    //   name: "文化服务",
    //   cid: "37",
    //   url: "A_SingleList.html",
    //   model: 'whfw'
    // },
    // {
    //   name: "科技科普",
    //   cid: "41",
    //   url: "A_SingleList.html",
    //   model: 'kjkp'
    // },
    // {
    //   name: "健康体育",
    //   cid: "47",
    //   url: "A_SingleList.html",
    //   model: 'jkty'
    // },
  ];

  function direOpt(index, directive) {
    if (directive == "up") {
      //上
      console.log("toptop");
      switch (index) {
        case 0:
        case 1:
        case 2:
          index = -1;
          break;
        case 3:
        case 4:
          index -= 2;
          break;
        case 5:
        case 6:
        case 7:
          index = 0;
          break;
        case 8:
        case 9:
          index -= 5;
          break;
      }
    } else if (directive == "down") {
      //下
      console.log("downdown");
      switch (index) {
        case -1:
          index = 0;
          break;
        case 0:
          index = 5;
          break;
        case 1:
        case 2:
          index += 2;
          break;
        case 3:
        case 4:
          index += 5;
          break;
      }
    } else if (directive == "backwards") {
      //左
      console.log("leftleftleft");
       if (index > 0) {
        index--;
      }
    } else if (directive == "forwards") {
      //右
      console.log("rightright");
      if (index < $(".model").length - 1) {
        index++;
      }
    }
    console.log(index);
    return index;
  }






  function direEnter(index) {
    console.log(index);
    if (index == 0) {
      window.location.href = data[index].url + "?mediaStr=" + mediaStr;
    }else if(index==3){
      Utility.startApkByIntent("cn.chen.sipcall.startapp","");
    }
     else {
      window.location.href = data[index].url + "?titles=" + data[index].name + "&model=" + data[index].model;
    }
  }

  function exitPage() {
    try {
      mp.stop();
      // statements
    } catch (e) {
      // statements
      console.log(e);
    }
  }

  // right.toggleFocus();
</script>

<script type="text/javascript" src="js/index.js"></script>

</html>